// src/router/routes.ts
import type { RouteRecordRaw } from 'vue-router' // 添加type关键字
// import Home from '@/views/Home/Home.vue'
// import News from '@/views/News/News.vue'
// import Network from '@/views/Network/Network.vue'
// import Dating from '@/views/Dating/Dating.vue'
// import App from '@/views/App/App.vue'
// import Ecosystem from '@/views/Ecosystem/Ecosystem.vue'
// import About from '@/views/About/About.vue'
// import About from '@/views/About.vue'
// import I18nDemo from '../views/I18nDemo.vue'
// import Layout from '@/layout/Layout.vue'
const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: () => import('@/layout/Layout.vue'), // 动态导入
    children: [
      {
        path: '',
        name: 'Home',
        meta: {
          keepAlive: false
        },
        component: () => import('@/views/Home/Home.vue')
      },
      {
        path: 'news',
        name: 'News',
        meta: {
          title: '友福动态',
          keepAlive: false
        },
        component: () => import('@/views/News/News.vue')
      },
      {
        path: 'articleDetail/:id',
        name: 'articleDetail',
        meta: {
          title: '文章详情',
          keepAlive: false // 详情页不缓存
        },
        component: () => import('@/views/News/ArticleDetail.vue')
      },
      {
        path: 'network',
        name: 'Network',
        meta: {
          title: 'AI健康',
          keepAlive: false
        },
        component: () => import('@/views/Network/Network.vue')
      },
      {
        path: 'dating',
        name: 'Dating',
        meta: {
          title: 'AI婚恋',
          keepAlive: false
        },
        component: () => import('@/views/Dating/Dating.vue')
      },
      {
        path: 'app',
        name: 'App',
        meta: {
          title: '友福同享APP',
          keepAlive: false
        },
        component: () => import('@/views/App/App.vue')
      },
      {
        path: 'ecosystem',
        name: 'Ecosystem',
        meta: {
          title: '生态合作',
          keepAlive: false
        },
        component: () => import('@/views/Ecosystem/Ecosystem.vue')
      },
      {
        path: 'about',
        name: 'About',
        meta: {
          title: '关于我们',
          keepAlive: false
        },
        component: () => import('@/views/About/About.vue')
      }
    ]
  },
  // {
  //   path: '/i18n-demo',
  //   name: 'I18nDemo',
  //   component: I18nDemo,
  //   meta: {
  //     title: '国际化演示'
  //   }
  // },
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home,
  //   meta: {
  //     title: '首页 - 极简官网' // 明确指定title为string类型
  //   } as { title: string } // 强制类型断言
  // },
  // {
  //   path: '/about',
  //   name: 'About',
  //   component: About,
  //   meta: {
  //     title: '关于我们 - 极简官网'
  //   } as { title: string }
  // },
  {
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    component: () => import('@/views/NotFound.vue'),
    meta: { title: '404 - 页面不存在' } as { title: string }
  }
]

export default routes
